package com.tzjw.marketweixin.exception;

import com.tzjw.marketweixin.exception.errorcode.ErrorCode;

/**
 * CustomException 自定义异常类
 * arg0：表示异常的详细描述或者错误消息。
 * arg1：表示异常的原因，即导致异常的其他异常。
 * arg2：表示是否启用异常的抑制和堆栈轨迹的记录。
 * arg3：表示是否保持异常的原因和抑制状态。
 * @author hayden
 * @since 2023/09/17 09:12
 */
public class CustomException extends RuntimeException{
    private ErrorCode errorCode;

    public CustomException() {
        super();
    }

    public CustomException(ErrorCode errorCode) {
        super();
        this.errorCode = errorCode;
    }


    public CustomException(String arg0) {
        super(arg0);
    }

    public CustomException(Throwable arg0) {
        super(arg0);
    }

    public CustomException(String arg0, Throwable arg1) {
        super(arg0, arg1);
    }

    public CustomException(ErrorCode errorCode, String arg0) {
        super(arg0);
        this.errorCode = errorCode;
    }

    public CustomException(ErrorCode errorCode, Throwable arg0) {
        super(arg0);
        this.errorCode = errorCode;
    }

    public CustomException(ErrorCode errorCode, String arg0, Throwable arg1) {
        super(arg0, arg1);
        this.errorCode = errorCode;
    }

    public CustomException(String arg0, Throwable arg1, boolean arg2, boolean arg3) {
        super(arg0, arg1, arg2, arg3);
    }

    public CustomException(ErrorCode errorCode, String arg0, Throwable arg1, boolean arg2, boolean arg3) {
        super(arg0, arg1, arg2, arg3);
        this.errorCode = errorCode;
    }

    public void setErrorCode(ErrorCode errorCode) {
        this.errorCode = errorCode;
    }

    public ErrorCode getErrorCode() {
        return errorCode;
    }
}


